<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head th:include="comment/comment::header"></head>
	<body>
	<!--引入头部-->
	<div th:replace="comment/comment::top"></div>
	<div class="container-fluid">
		<div class="row">
			<!--引入菜单-->
			<div th:replace="comment/comment::left (active=${'emps'})"></div>
				<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<form th:action="@{/emp}" method="post">
						<input type="hidden" th:if="${emp != null}" name="_method" value="put">
						<input type="hidden" th:if="${emp != null}" name="id" th:value="${emp.id}">
						<div class="form-group">
							<label>LastName</label>
							<input type="text" name="lastName" class="form-control" placeholder="zhangsan" th:value="${emp!=null}?${emp.lastName}">
						</div>
						<div class="form-group">
							<label>Email</label>
							<input type="email" name="email" class="form-control" placeholder="zhangsan@atguigu.com" th:value="${emp != null}?${emp.email}">
						</div>
						<div class="form-group">
							<label>Gender</label><br/>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="gender" value="1" id="man" th:checked="${emp != null}?${emp.gender==1}">
								<label class="form-check-label" for="man">男</label>
							</div>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="gender"  value="0" id="nv" th:checked="${emp != null}?${emp.gender==0}">
								<label class="form-check-label" for="nv">女</label>
							</div>
						</div>
						<div class="form-group">
							<label>department</label>
							<select class="form-control" name="department.id">
								<option th:each="d:${dept}" th:text="${d.departmentName}" th:value="${d.id}" th:selected="${emp != null}?${emp.department.id == d.id}">1</option>
							</select>
						</div>
						<div class="form-group">
							<label>Birth</label>
							<input type="text" name="birth" class="form-control" placeholder="1998-10-26" th:value="${emp != null}?${#dates.format(emp.birth,'yyyy/MM/dd HH:ss')}">
						</div>
						<button type="submit" class="btn btn-primary" th:text="${emp != null}?'修改':'添加'">添加</button>
					</form>
				</main>
			</div>
		</div>
		<div th:include="comment/comment::scripts"></div>
	</body>

</html>